//
//  Swift_CBDTableViewCellModel.swift
//  SwiftTestDemo
//
//  Created by John on 2018/5/28.
//  Copyright © 2018年 company. All rights reserved.
//

import UIKit

typealias CBDCellRenderBlock = (_ indexPath:IndexPath,  _ tableView:UITableView) -> (UITableViewCell)

typealias CBDCellWillSelectBlock = (_ indexPath:IndexPath,  _ tableView:UITableView) -> (IndexPath)

typealias CBDCellSelectionBlock = (_ indexPath:IndexPath,  _ tableView:UITableView) -> Void

typealias CBDCellWillDisplayBlock = (_ cell:UITableViewCell, _ indexPath:IndexPath,  _ tableView:UITableView) -> Void

typealias CBDCellCommitEditBlock = (_ indexPath:IndexPath, _ editingStyle:UITableViewCellEditingStyle,  _ tableView:UITableView) -> Void

typealias CBDCellEditActionsBlock = (_ indexPath:IndexPath,  _ tableView:UITableView) -> ([UITableViewRowAction])

typealias CBDCellHeightBlock = (_ indexPath:IndexPath,  _ tableView:UITableView) -> (CGFloat)

class Swift_CBDTableViewCellModel: NSObject {

    var renderBlock:CBDCellRenderBlock?
    
    func renderBlockAction(block:CBDCellRenderBlock?) {
        self.renderBlock = block
    }
    
    var willDisplayBlock:CBDCellWillDisplayBlock?
    
    func willDisplayBlockAction(block:CBDCellWillDisplayBlock?) {
        self.willDisplayBlock = block
    }
    
    var willSelectBlock:CBDCellWillSelectBlock?
    
    func willSelectBlockAction(block:CBDCellWillSelectBlock?) {
        self.willSelectBlock = block
    }
    
    var willDeselectBlock:CBDCellWillSelectBlock?
    
    func willDeselectBlockAction(block:CBDCellWillSelectBlock?) {
        self.willDeselectBlock = block
    }
    
    var selectionBlock:CBDCellSelectionBlock?
    
    func selectionBlockAction(block:CBDCellSelectionBlock?) {
        self.selectionBlock = block
    }
    
    var deselectionBlock:CBDCellSelectionBlock?
    
    func deselectionBlockAction(block:CBDCellSelectionBlock?) {
        self.deselectionBlock = block
    }
    
    var beginEditingBlock:CBDCellSelectionBlock?
    
    func beginEditingBlockAction(block:CBDCellSelectionBlock?) {
        self.beginEditingBlock = block
    }
    
    var endEditingBlock:CBDCellSelectionBlock?
    
    func endEditingBlockAction(block:CBDCellSelectionBlock?) {
        self.endEditingBlock = block
    }
    
    var commitEditBlock:CBDCellCommitEditBlock?
    
    func commitEditBlockAction(block:CBDCellCommitEditBlock?) {
        self.commitEditBlock = block
    }
    
    var heightBlock:CBDCellHeightBlock?
    
    func heightBlockAction(block:CBDCellHeightBlock?) {
        self.heightBlock = block
    }
    
    var editActionsBlock:CBDCellEditActionsBlock?
    
    func editActionsBlockAction(block:CBDCellEditActionsBlock?) {
        self.editActionsBlock = block
    }
    
    var height:CGFloat?
    
    var canEdit:Bool?
    
    var editingStyle:UITableViewCellEditingStyle?
    
    var deleteConfirmationButtonTitle:NSString?
    
}
